-
Notifications
You must be signed in to change notification settings - Fork 778
P2841R7 Concept and variable-template template-parameters #7690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
can be the product of replacing a | ||
\tcode{>>} token by two consecutive \tcode{>} | ||
tokens\iref{temp.names}. | ||
\end{note} | ||
|
||
\pnum | ||
%FIXME: "is" or "shall be"? i.e., what if it's not? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is. It's a close set. I do agree we never seem to define template parameter, this might be the right place to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you send a separate pull request to create such a definition?
a \grammarterm{template-name} for a template template parameter pack | ||
\end{itemize} | ||
designating the $i^\text{th}$ corresponding | ||
type, template, or constant template argument; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ordering of the bulleted list is "constant, type, template" but this part follows it up with "type, template, constant". Neither is consistent with the "type, constant, template" ordering that seems to be preferred elsewhere in the text.
\item if they declare template template parameters, | ||
%FIXME: What are "their kinds"? And what does it mean for kinds to be the same? | ||
%FIXME: We refer to "kinds" in [temp.param]/p2 but never define it. | ||
their kinds are the same and their \grammarterm{template-head}{s} are equivalent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is redundant with the first item on this list:
their kinds are the same and their \grammarterm{template-head}{s} are equivalent. | |
their \grammarterm{template-head}{s} are equivalent. |
Also, the grammar for concept-tt-parameter does not include a template-head, instead we have "template
<
template-parameter-list >
". The only difference between the two is the optional requires-clause, which (for concept template parameters) would be disallowed by [temp.param]/4 anyway, so we should probably just use "template-head".
\tcode{TT}, | ||
\tcode{TT} denoting a class template or an alias template, | ||
a template template argument | ||
\tcode{VV} denoting a variable template or a concept, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another instance of inconsistent ordering: here it's "T
, TT
, VV
, i
" but subsequent text uses "T
, i
, TT
, VV
".
each appearance of \tcode{C}{'s} template parameters in | ||
the parameter mappings of the atomic constraints | ||
(including concept-dependent constraints) | ||
in \tcode{CI$'$} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make sense to me. Per the previous paragraph, CI'
is the normal form of a concept-id whose concept is C
, so its parameter mappings shouldn't include any template parameters of C
(see [temp.constr.normal]/1.4).
The constraint is satisfied if \tcode{CI$''$} is satisfied. | ||
\begin{note} | ||
Checking whether \tcode{CI$''$} is satisfied | ||
can lead to further normalization of concept-dependent constraints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can lead to further normalization of concept-dependent constraints. | |
can lead to further satisfaction checking of concept-dependent constraints. |
template <typename T, template<typename> concept CC> | ||
concept D = CC<T>; | ||
|
||
template<typename T, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template<typename T, | |
template<typename U, |
This example deals with parameter mappings of atomic constraints, so using distinct names for template parameters seems preferable.
template<typename T, | ||
template<typename> concept CT, | ||
template<typename, template<typename> concept> concept CU> | ||
int f() requires CU<T, CT>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int f() requires CU<T, CT>; | |
int f() requires CU<U, CT>; |
(matching change for the above suggestion)
void g() requires CC<U*, C>; | ||
\end{codeblock} | ||
The normal form of the associated constraints of \tcode{f} is | ||
the concept-dependent constraint \tcode{CT<T, C>}.\\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the concept-dependent constraint \tcode{CT<T, C>}.\\ | |
the concept-dependent constraint \tcode{CT<U*, C>}.\\ |
\end{codeblock} | ||
The normal form of the associated constraints of \tcode{f} is | ||
the concept-dependent constraint \tcode{CT<T, C>}.\\ | ||
The normal form of the associated constraints of \tcode{g} is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The normal form of the associated constraints of \tcode{g} is | |
The the associated constraints of \tcode{g} are |
template<template<typename T> concept X, typename T> | ||
int f(S<X, T>) requires X<T> { return 43; } // \#2 | ||
|
||
f(S<A, int>{}); // ok, select \#1 because \#2 is not eligible for subsumption |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "#1
" and not "ambiguous"?
source/templates.tex
Outdated
A synthesized template has the same \grammarterm{template-head} as | ||
its corresponding template template parameter. | ||
|
||
\pnum | ||
\begin{note} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This note pertains to p3 but these changes place it at the very start of p5, which seems a bit odd.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The paper unfortunately gives rather insufficient editing context. @cor3ntin Please indicate more clearly where new paragraphs are intended to be created. As it is, the fate of the original note is unclear.
@lprv Thanks for your excellent review! I applied some of your suggestions (and might be able to apply a couple more), but several of them are beyond simple editorial fixes, hence outside the scope of applying this motion. Please open issues for these! |
3722ca4
to
745fbf7
Compare
Editorial notes: * [temp.param]temp.arg.type] Some instructions do not apply due to more recent changes in the wording. * [temp.param] Added a reference for concept-dependent to where it's defined. * [temp.param] Move reference after "concept-dependent constraint". * [temp.constr.concept] Replace "may" with "might" inside note. * [temp.constr.concept] Add a reference for "normal form". * [temp.func.order] Move note to remain with the relevant context.
This fixes an oversight in the paper.
11eabe9
to
1749957
Compare
Thanks for the suggestions. We've applied a few of them, but for matters that are mostly personal preference, please file a separate editorial pull request later.
[temp.param], [temp.arg.type] Some instructions do not apply due to more recent changes in the wording.
[temp.param] Added a reference for concept-dependent to where it's defined. [temp.constr.concept] Replace "may" with "might" inside note.
Fixes #7657.
Also fixes cplusplus/papers#1546
Notes: